package ar.com.utn.openqsb.lip.core;

import org.apache.commons.math.linear.RealVector;
import org.apache.commons.math.linear.RealVectorImpl;

public class Objective
{

	public static enum Type
	{
		MINIMIZE, MAXIMIZE;
	}

	private Type type;

	private RealVector coefficients;

	private double constantTerm;

	public Objective(int numVars)
	{
		type = Type.MAXIMIZE;
		coefficients = new RealVectorImpl(new double[numVars]);
	}

	public void setType(final Type type)
	{
		this.type = type;
	}

	public Type getType()
	{
		return type;
	}

	public void setCoefficient(final int index, final double coefficient)
	{
		coefficients.setEntry(index, coefficient);
	}

	public RealVector getCoefficients()
	{
		return coefficients;
	}

	public double getConstantTerm()
	{
		return constantTerm;
	}

	public void setConstantTerm(double constantTerm)
	{
		this.constantTerm = constantTerm;
	}

}
